TECInfo
The converter information structure is used by the functionTECGetInfo
(page 55) to hold returned information about the Unicode Converter, the Text Encoding Converter, and Basic Text Types.
struct TECInfo { UInt16 format; UInt16 tecVersion; UInt32 tecTextConverterFeatures; UInt32 tecUnicodeConverterFeatures; UInt32 tecTextCommonFeatures; Str31 tecTextEncodingsFolderName; Str31 tecExtensionFileName; }; typedef struct TECInfo TECInfo; typedef TECInfo * TECInfoPtr; typedef TECInfoPtr * TECInfoHandle; enum { kTECInfoCurrentFormat = 1 }; enum { kTECKeepInfoFixBit = 0, kTECFallbackTextLengthFixBit = 1 kTECTextRunBitClearFixBit = 2, kTECTextToUnicodeScanFixBit = 3, kTECAddForceASCIIChangesBit = 4, kTECPreferredEncodingFixBit = 5 }; enum { kTECKeepInfoFixMask = 1L << kTECKeepInfoFixBit, kTECFallbackTextLengthFixMask = 1L << kTECFallbackTextLengthFixBit kTECTextRunBitClearFixMask = 1L << kTECTextRunBitClearFixBit, kTECTextToUnicodeScanFixMask = 1L << kTECTextToUnicodeScanFixBit, kTECAddForceASCIIChangesMask = 1L << kTECAddForceASCIIChangesBit, kTECPreferredEncodingFixMask = 1L << kTECPreferredEncodingFixBit };
Field Description
format
- The current format of the returned structure. The format of the structure is indicated by the
kTECInfoCurrentFormat
constant. Any future changes to the format will always be backward compatible; any new fields will be added to the end of the structure.tecVersion
- The current version of the Text Encoding Conversion Manager extension in BCD (binary coded decimal), with the first byte indicating the major version; for example, 0x0121 for 1.2.1.
tecTextConverterFeatures
- New features or bug fixes in the Text Encoding Converter. No bits are currently defined.
tecUnicodeConverterFeatures
- Bit flags indicating new features or bug fixes in the Unicode Converter. The bits currently defined are
kTECKeepInfoFixBit
,kTECFallbackTextLengthFixBit
,kTECTextRunBitClearFixBit
, andkTECTextToUnicodeScanFixBit
,kTECAddForceASCIIChangesBit
, andkTECPreferredEncodingFixBit
; the corresponding masks arekTECKeepInfoFixMask
,kTECFallbackTextLengthFixMask
,kTECTextRunMaskClearFixMask
,kTECTextToUnicodeScanFixMask
,kTECAddForceASCIIChangesMask
, andkTECPreferredEncodingFixMask
.
- The
kTECKeepInfoFixBit
is set if the Unicode Converter has a bug fix to stop ignoring certain control flags if thekUnicodeKeepInfoBit
flag is set.
- The
kTECFallbackTextLengthFixBit
is set if the Unicode Converter has a bug fix to use the source length (srcConvLen)
and destination length (destConvLen)
returned by a caller-supplied fall-back handler for any status it returns exceptkTECUnmappableElementErr
.Previously it honored only these values if
noErr
was returned.
- The
kTECTextRunBitClearFixBit
is set ifConvertFromUnicodeToTextRun
andConvertFromUnicodeToScriptCodeRun
function correctly if thekUnicodeTextRunBit
is clear.
- The
kTECTextToUnicodeScanFixBit
is set ifConvertFromTextToUnicode
is enhanced so mappings can depend on context and saved state. The consequences of this are (1) malformed input results inkTextMalformedInputErr
; (2)ConvertFromTextToUnicode
accepts the control flagskUnicodeLooseMappingsMask
,kUnicodeKeepInfoMask
, andkUnicodeStringUnterminatedMask
; (3) elimination of redundant direction overrides when converting Mas OS Arabic and Hebrew to Unicode; and (4) improved mapping of 0x30-0x39 digits in Mac OS Arabic when loose mappings are used.tecTextCommonFeatures
- Bit flags indicating new features or bug fixes in Basic Text Types (the Text Common static library). No bits are currently defined.
tecTextEncodingsFolderName
- A Pascal string with the (possibly localized) name of the Text Encodings folder.
tecExtensionFileName
- A Pascal string with the (possibly localized) name of the Text Encoding Conversion Manager extension file.
kTECAddForceASCIIChangesBit
is set if the new control flag bitskUnicodeForceASCIIRangeBit
andkUnicodeNoHalfwidthCharsBit
are supported for use with the functionsConvertFromTextToUnicode
,ConvertFromUnicodeToText
and so forth.
kTECPreferredEncodingFixBit
is set to indicae that a preferred encoding is specified forCreateUnicodeToTextRunInfo
and related functions, they handle it correctly even if it does not match the system script.